package com.farm.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.farm.pojo.SpiderData;
import com.farm.mapper.SpiderDataMapper;
import com.farm.service.SpiderDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author farm
 * @since 2024-08-10
 */
@Service
public class SpiderDataServiceImpl extends ServiceImpl<SpiderDataMapper, SpiderData> implements SpiderDataService {


    @Override
    public Page<SpiderData> getShowList(int current, int size,String type) {
        Page<SpiderData> pageInfo = new Page<>(current, size);

        this.page(pageInfo, Wrappers.<SpiderData>lambdaQuery()
                .eq(SpiderData::getCategory,type)
                .orderByDesc(SpiderData::getCreateTime));

        return pageInfo;
    }
}
